/**
 * Charles 20161026
 */

$(function(){
	var vmMain = new Vue({
        el: '#contentBody',
        data: {
            newsList: [],
            pagesLength:0
        }
    });
    $.ajax({
        url: "new",
        type: "POST",
        dataType: "json",
        data: { pageIndex: 0, pageCount: 8 },
        success: function (result) {
            vmMain.newsList = result;
        },
        error: function (result) {
            return;
        }
    });
	var pageCount = Math.ceil(vmMain.newsList.length/25);
        vmMain.pagesLength=pageCount;
    if(pageCount>1)
    {
		$('#dark-pagination').pagination({
			pages: pageCount,
			cssStyle: 'dark-theme',
			displayedPages: 3,
			edges: 2
		});
    }
});
